# Use official Node.js 18 alpine image
FROM alibaba-cloud-linux-3-registry.cn-hangzhou.cr.aliyuncs.com/alinux3/node:20

USER root

# Create app directory
WORKDIR /app

# Copy package.json and package-lock.json
COPY package*.json ./

# Install dependencies
RUN npm install

# Copy all source files and SSL certificates
COPY ./src ./src
COPY ./public ./public
COPY ./ssl ./ssl

# Expose the port the app runs on
EXPOSE 3000

# Start the application
CMD ["npm", "start"]